import Vue from 'vue'
import Vuex from 'vuex'
import da from "element-ui/src/locale/lang/da";

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    routes: [],
    loginServiceApi:"loginserviceapi",
    timeServiceApi:"timeserviceapi",
    // loginActiveName:"login",
    forgetVisible:false,
    user:null,
    headerSetting:false,
    count:0,
    articleData:[],
    isAdmin:false,

  },

  // 改变state数据
  mutations: {
    initRoutes(state, data) {
      state.routes = data
    },
    // initLoginActiveName(state,data){
    //   state.loginActiveName = data
    // },
    initForgetVisible(state,data){
      state.forgetVisible = data
    },
    initUser(state,data){
      state.user = data
    },
    initHeaderSetting(state,data){
      state.headerSetting = data
    },
    innitCount(state,data){
      state.count = state.count + data
    },
    innitArticleData(state,data){
      data.forEach(item =>{
        state.articleData.push(item)
      })
    },
    initIsAdmin(state, data) {
      state.isAdmin = data
    },
  },

  actions: {}

})
